﻿using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace NoteHelper.CustomControls
{
    public class CyLabel : UserControl
    {
        public CyLabel()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
        }

        private string _text = "";

        [Description("内容"), Category("Appearance")]
        public new string Text
        {
            get { return _text; }
            set
            {
                _text = value;
                this.Refresh();
            }
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            var g = e.Graphics;
            g.DrawString(_text, this.Font, new SolidBrush(Color.Black), new PointF(0, 3));
        }

        private void InitializeComponent()
        {
            this.SuspendLayout();
            // 
            // CyLabel
            // 
            this.Name = "CyLabel";
            this.Text = "CyLabel";
            this.Size = new System.Drawing.Size(214, 30);
            this.ResumeLayout(false);

        }
    }
}
